<?php
/**
 * @version		$Id: servers.php 3 2011-12-16 20:19:15Z netix.mail@gmail.com $
 * @package		ALM Hoster
 * @desription	Web hosting and domain menager for resellers
 * @subpackage	Components
 * @copyright	Copyright (C) 2011 ALM Studio. All rights reserved.
 * @author		ALM Studio
 * @email		info@alm-studio.net
 * @link		http://alm-studio.net
 * @license		Commercial
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.controlleradmin');


class AlmHosterControllerServers extends JControllerAdmin
{
	public function getModel($name = 'Server', $prefix = 'AlmHosterModel') 
	{
		$model = parent::getModel($name, $prefix, array('ignore_request' => true));
		return $model;
	}
	
	
	function accounts() {
		$app = JFactory::getApplication();
		
		$model       = &$this->getModel ( 'servers' );
		if (function_exists("curl_init"))
		{	
			$_importAccounts = $model->_importAccounts ();	
			$msg         = JText::_( 'COM_ALMHOSTER_WHM_ACCOUNTS_IMPORTED' ) ;		
			$urlredirect = "index.php?option=com_almhoster&view=servers";
			$app->redirect( $urlredirect, $msg );	
		} else {
			$msg         = JText::_( 'COM_ALMHOSTER_CURL_NOT_ENABLED' ) ;	
			$urlredirect = "index.php?option=com_almhoster&view=servers";
			$app->redirect( $urlredirect, $msg );		
		}
	
	}
}
